semvec/pypi-packages huggingface dataset:
aiocord.py 0.0.1
A simple wrapper for Discord API written in Python.
License: MIT
Requires Python: >=3.8.0

<div align="center">
  <h1>AIOCord</h1>
  <sup><a href='#note'>This project is work in progress not for production use</a></sup>
  <hr>
  <p>A simple asynchronous API wrapper around Discord API written in Python.</p>
</div>

## Inspiration
This library is a side project of [mine](https://github.com/nerdguyahmad) which I started as an inspiration of [discord.py by Rapptz](https://github.com/Rapptz/discord.py), The aim of this library is to provide a simple interface to interact with Discord API by abstracting away most of the complications. 

## Note
This library is work in progress and NOT meant for production use and is a total experimental and fun project, If you are looking for a solid library for developing 
a production ready bot, then checkout few of the other projects (biased list):

- [Discord.py](https://github.com/Rapptz/discord.py)
- [Diskord](https://github.com/diskord-dev/diskord) <sup>(biased)</sup>
- [Hikari](https://github.com/hikari-py/hikari)

## Usage
This is a currently concept or idea of library future design:
```py
import aiocord
import asyncio

client = aiocord.Client()

@client.listener()
async def on_message(message):
  if message.author.bot: # don't respond to a bot (or ourself)
    return

  if message.content.lower() == '>ping':
    await message.channel.send('Pong!')

loop = asyncio.get_event_loop()
loop.run_until_complete(client.connect('bot-token-here'))
```
You can find more examples in `/examples` directory.

## Contributing
While this is a fun project doesn't mean this library is not looking for contributions, it is! You are free to [contribute to this library](CONTRIBUTING.MD)
mep-api 0.1.2
A web scraping package for data on members of the European Parliament.
License: MIT
Requires Python: >=3.7

# MEP API
MEP API is a very simple python package to scrape data on members of the European Parliament and output it in a neat JSON.

### Installation
Install this repository with pip:
```
pip install mep_api
```

### Usage

#### Scraping one MEP's information
To create an MEP object, import the package pass the URL of an MEP's EP home page. For instance:
```python
import mep_api
mep1 = mep_api.mep("https://www.europarl.europa.eu/meps/en/113892/ERIC_ANDRIEU/home")
```
Then you can add the information you want to the object:
```python
mep1.get_personal_data()
mep1.get_committees()
mep1.get_assistants()
```
or you can scrape everything at once:
```python
mep1.scrape_all()
```
You can then either get a JSON string containing all of the MEP's information and write to a file by running:
```python
mep1.to_json() #returns JSON string
mep1.to_json("file.json") #writes JSON file to specified path
```

#### Scraping multiple MEPs' information
It is possible to scrape data for multiple MEPs with a single line of code with `batch_scrape()` as follows:
```python
url_list = ["https://www.europarl.europa.eu/meps/en/113892/ERIC_ANDRIEU/home", "https://www.europarl.europa.eu/meps/en/124831/ISABELLA_ADINOLFI/home", "https://www.europarl.europa.eu/meps/en/28161/MARGRETE_AUKEN/home"]
mep_api.batch_scrape(url_list) #return JSON string
mep_api.batch_scrape(url_list, outfile="file.json") #writes JSON file to specified path
```
The `get_mep_urls()` function returns a list of all MEP home page URLs and makes collecting data on all MEPs at once easy. It is also possible to scrape available data for so-called "outgoing" MEPs, MEPs who have left the parliament during the current parliamentary term. To do so, it is sufficient to use the `batch_scrape()` function with the argument `add_outgoing = True` which is `False` by default. It is possible not to pass a `url_list` to the function to collect data only on outgoing MEPs. It is however not possible to collect data on single outgoing MEPs as of now.
```python
all_mep_urls = mep_api.get_mep_urls() #creates a list of all MEP URLS
mep_api.batch_scrape(all_mep_urls) #collects data on all current MEPs
mep_api.batch_scrape(all_mep_urls, add_outgoing=True) #collects data on all current MEPs and outgoing MEPs
mep_api.batch_scrape(add_outgoing=True) #collects data on outgoing MEPs
```