Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

h2b7/ranker_writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Script to get a json key_tree by key and saving the content of the key by key_tree

  • yet another parser (not searched the www for scripts that may solve my task)
{"a": 1, "b": 2, "d": {"c": 3}}		# 'root -> d -> c'
{"a": 1, "b": 2, "d": [{"c": 3}]}	# 'root -> d -> c'

Dependencies

pip -V		# 22.1.1
python -V	# 3.10.5
pytest -V	# 6.2.5

Start

python -m venv env && source env/bin/activate
pip install -r requirements.txt

# check functions if necessary
pytest .

# run script
python src/run.py

Script structure

.
├── src
│   ├── __init__.py
│   └── run.py
├── tests
│   ├── __init__.py
│   ├── test_get_page_data.py
│   └── test_page_data_tree.py
├── data
│   ├── key_content-ignore_me.json
│   └── ranker_writer-ignore_me.json
├── README.md
├── CONTRIBUTORS.md
└── requirements.txt

TODO

  • nested json
  • json in the list
  • check for multiple keys
    • return multiple keys (iterable result)
    • unique multiple keys (not every single item in the list)
  • check for keys by value
  • access to the data in the list
    • added default index = 0
    • add and get the index from key_tree
  • handle errors on searching for a non string key
  • handle errors on request and parsing
    • check for no url
  • fix errors on reading and writing to the json file without filename
    • add tests

Coding process: https://youtu.be/DkBAIKMN7x0

About

Parsing the ranker website content (writers json file)

Resources

License

Stars

Watchers

Forks

Languages