Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/edmartt/datagetter
https://github.com/edmartt/datagetter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/edmartt/datagetter
- Owner: Edmartt
- Created: 2021-08-04T21:22:50.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-07T08:33:16.000Z (over 1 year ago)
- Last Synced: 2024-10-02T09:14:18.774Z (about 1 month ago)
- Language: Python
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Datagetter
This script fetch data from fifa fut21 api and complementary for using [rest-fut21](https://github.com/Edmartt/rest-fut21)
## Install:
### On Windows
```
git clone https://github.com/Edmartt/datagetter.git
``````
cd datagetter/
``````
pip install -r requirements.txt
``````
set MYSQL_HOST=0.0.0.0
``````set MYSQL_USER=the same username for the database user in [rest-fut21](https://github.com/Edmartt/rest-fut21)```
```set MYSQL_PASSWORD=same as above, put the same password that you have for your mariadb/mysql instance```
```set MYSQL_DATABASE=the same as rest-fut21```
```set MYSQL_PORT=32000 (this is a forwarded port from the same container running rest-fut21 service)```
### On Linux
```
git clone https://github.com/Edmartt/datagetter.git
```
```
cd datagetter/
``````
pip install -r requirements.txt
``````
export MYSQL_HOST=0.0.0.0
``````export MYSQL_USER=the same username used for rest-fut21```
```export MYSQL_PASSWORD=the same used for rest-fut21``````export MYSQL_DATABASE=the same database for rest-fut21```
```export MYSQL_PORT=32000 (this is a forwarded port from the same container running rest-fut21 service)```
#### Note:
**it requires that the container with the rest21 service it's started**
Set a **.env** file for using before running following the **.env.example** file
## Running:
### On Windows:
$ python script.py
### On Linux:
$ python3 script.py
The script will do a GET request to [Fifa Ultimate Team](https://futdb.app/api) API and will save the data in the rest-fut21 project container database. Every successful request it will ask if we want to continue and if we answer a **y** it will keep saving the data for every available page with data. If we type **n** the script will end of getting pages data and now we can use rest-fut21 making request according to docs in the readme.If you want to test the saved data just create a connection with the MariaDB/MySQL client installed on your local machine
#### Note:
Remember that you will be running the rest-fut21 project first with docker-compose, and this is necessary because we need to save the data in mariadb/mysql volumen for querying this data later in rest-fut21 service
i.e:
$ mariadb -u username -h 0.0.0.0 -P -p mypassword
Or:
$ mariadb -u username -h 0.0.0.0 -P -p (press enter)
Password: *********