Coder Social home page Coder Social logo

mailtm's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @prtolem
  • ๐Ÿ‘€ Iโ€™m interested in python and VR
  • ๐ŸŒฑ Iโ€™m currently learning Data Science
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on yandex
  • ๐Ÿ“ซ How to reach me @derkonw

mailtm's People

Contributors

fallenastaroth avatar prtolem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

enriluis

mailtm's Issues

error: 'await' outside async function

I cloned your repo inside my project, so I have this setup:
./MailTM
./myproject.py

In myproject.py I pasted your example code:

from MailTM.mailtm import MailTM


def main() -> None:
    mailtm = MailTM()
    result = await mailtm.get_account_token(address="example", password="example")
    print(result)


if __name__ == '__main__':
    main()

and I get this error: SyntaxError: 'await' outside async function
so I edited the code adding async before def main():

from MailTM.mailtm import MailTM


async def main() -> None:
    mailtm = MailTM()
    result = await mailtm.get_account_token(address="example", password="example")
    print(result)


if __name__ == '__main__':
    main()

I installed pydantic and aiohttp and now the error is:

RuntimeWarning: coroutine 'main' was never awaited
  main()
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

MailTM error & Fix potentially

An error I encountered

    from .mailtm import MailTM
  File "C:\Users\Tal A. Baskin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\mailtm\mailtm.py", line 6, in <module>
    from .schemas.domains import Domains, Domain
  File "C:\Users\Tal A. Baskin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\mailtm\schemas\domains.py", line 14, in <module>
    class Domains(BaseModel):
  File "C:\Users\Tal A. Baskin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\mailtm\schemas\domains.py", line 16, in Domains
    hydra_member: list[Domain] = Field(alias="hydra:member")
TypeError: 'type' object is not subscriptable

From my limited research as I don't really have enough time to do all of it, this problem can be fixed by simply changing the imports in domains.py and message.py from

from pydantic import BaseModel, Field

to

from pydantic import BaseModel as PydanticBaseModel
from pydantic import Field
from pydantic.dataclasses import dataclass

class BaseModel(PydanticBaseModel):
    class Config:
        arbitrary_types_allowed = True

Above at the top of every file where arbitrary types are used, and as a suggestion to make this run on more Python version I'd avoid using stuff like list[str], It takes maybe 1 more line or 2 to validate if an element, my solution did seem to fix it for me as I am using Python 3.8.7 for this project.

In domains.py I changed hydra_member: list[Domain] to hydra_member: list
And in message.py every arbitrary value like list[someObject] I changed to list
To fix this issue.

I have no confirmed the integrity of the code as in, will it run or not. But I will try, If I encounter more errors I will document them here, If at all possible.

Cheers!

TypeError: 'type' object is not subscriptable

I'm getting this error in a simple example:

`from mailtm import MailTM
import asyncio
address = "myaccount"
password = "mypassword"

async def main() -> None:
    mailtm = MailTM()
    result = await mailtm.get_account_token(address, password)
    print(result)


if __name__ == '__main__':
    asyncio.run(main())

`

Traceback (most recent call last):
File "mailtm.py", line 1, in
from mailtm import MailTM
File "/home/lmb/MailTM/mailtm/init.py", line 1, in
from .mailtm import MailTM
File "/home/lmb/MailTM/mailtm/mailtm.py", line 6, in
from .schemas.domains import Domains, Domain
File "/home/lmb/MailTM/mailtm/schemas/domains.py", line 14, in
class Domains(BaseModel):
File "/home/lmb/MailTM/mailtm/schemas/domains.py", line 16, in Domains
hydra_member: list[Domain] = Field(alias="hydra:member")
TypeError: 'type' object is not subscriptable

issue

ImportError: cannot import name 'MailTM' from 'mailtm' (C:\Users\marin\AppData\Local\Programs\Python\Python311\Lib\site-packages\mailtm_init_.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.