e-MEC API
API Python para consulta na base de dados oficial de informações relativas às Instituições de Educação Superior (e-MEC).
Essa API faz requests e parse no Html do site do e-MEC para coletar informações sobre as instituições e os cursos de cada campus.
IMPORTANTE: Frequentemente o site do e-MEC fica indisponível, sendo assim verifique antes de realizar muitas requisições usando a API.
e-MEC - Ministério da Educação
Instalação
Você pode instalar o último release estável pelo PyPI
pip install emec-api
Dependências
Para o ambiente de desenvolvimento utilize o poetry para instalar as dependências do projeto.
poetry install
Como usar
Para utilizar o pacote em seu projeto importe a classe Institution e utilize conforme abaixo:
O código da instituição de ensino pode ser localizado no site do e-MEC.
from emec_api.api.client import Institution
ies = Institution(22)
ies.parse()
df_inst = ies.get_institution_dataframe()
print(df_inst.head())
df_campus = ies.get_campus_dataframe()
print(df_campus.head())
df_courses = ies.get_courses_dataframe()
print(df_courses.head())
# export to json
ies.to_json("emec.json")
# export to csv
ies.to_csv("emec.csv")
Para utilizar a ferramenta de linha de comando veja os exemplos abaixo:
Comandos disponíveis
USAGE
emec [-h] [-q] [-v [<...>]] [-V] [--ansi] [--no-ansi] [-n] <command> [<arg1>] ... [<argN>]
ARGUMENTS
<command> The command to execute
<arg> The arguments of the command
GLOBAL OPTIONS
-h (--help) Display this help message
-q (--quiet) Do not output any message
-v (--verbose) Increase the verbosity of messages: "-v" for normal output, "-vv" for more
verbose output and "-vvv" for debug
-V (--version) Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n (--no-interaction) Do not ask any interactive question
AVAILABLE COMMANDS
about Shows information about emec api
help Display the manual of a command
scraper This command is used to scraper institutions data from emec.
Coletar dados da ies 4150 e exibir os dados no terminal
emec scraper --ies 4150
Coletar dados da ies 4150 e exportar para o formato padrão (JSON)
emec scraper --ies 4150 --output institution.json
Coletar dados da ies 4150 e exportar alterando o formato para CSV
emec scraper --ies 4150 --format csv --output institution.csv
Coletar dados de várias instituições usando o arquivo csv exportado pelo site do e-MEC
emec scraper --file list_institutions.csv
O arquivo de exemplo exportado pelo e-MEC pode ser encontrado aqui
Metadata
Release files for emec-api 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| emec_api-0.1.10.tar.gz | 9.5 kB | Without provenance | Details for emec_api-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| emec_api-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for emec_api-0.1.10-py3-none-any.whl |
Total release size: 19.8 kB
Release files / emec_api-0.1.10.tar.gz
| Download URL | emec_api-0.1.10.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07c5690b62ce8009c042b650047e2fa405f530d228311f49b5352803e9160c10
|
|
BLAKE2b-256 checksum How to use checksums |
33bf86a2f5b9b9f7679afe7682b67b6a345d5adb49a44558a387a7a95bdb6359
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.15
|
Release files / emec_api-0.1.10-py3-none-any.whl
| Download URL | emec_api-0.1.10-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ec103d241cbfba3a82eb36750b29aad81cd3cb699da171368567fc63b5ed401
|
|
BLAKE2b-256 checksum How to use checksums |
26ce25d4c60ab972517003f9afffc5f8df91cf992e6afd884b36627e5d3a4606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.15
|
Security for emec-api 0.1.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.