Skip to main content

e-MEC API

PyPI Latest Release PyPI Downloads Code style: black Imports: isort security: bandit

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)

Source distribution for emec-api 0.1.10
File Size Uploaded
emec_api-0.1.10.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for emec-api 0.1.10
File Interpreter ABI Platform
emec_api-0.1.10-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.10 This release

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page