Welcome to EMC Info’s documentation!

Installation

pip install EMC-info

Note

If you need to use the package asynchronously, you need to install it with the async option

pip install EMC-info[async]

Usage

Importing:

import emc

Getting info about a town and printing its mayor’s name:

town = emc.Town("town")
print(town.mayor.name)

See the API Reference for all the attributes and classes available

Data

Most classes accept a parameter named data. This is so that you don’t have to wait for it to get the data every time you want to get info about something, you can get the value of the parameter with emc.util.get_data()

Note

Use emc.async_.get_data() if you are using the package asynchronously.

data = emc.util.get_data()
town_a = emc.Town("town", data=data)
town_b = emc.Town("other town", data=data)

Asynchronous usage

If you are using this package asynchronously you will need to manually get data using emc.async_.get_data()

town = emc.Town("town", data=await emc.async_.get_data())

Note

You may want to import emc.async_.get_data() so that you don’t have to type emc.async_. every time you want to get info about something

from emc.async_ import get_data

Then you can get info like this:

town = emc.Town("town", data=await get_data())

Help

If you get stuck, feel free to start a discussion

If this documentation is missing something, open an issue