Python library for dealing with text
Project description
Vocabulary Extension
This project is a chrome extension that can parse through your screen and determine which vocabulary words you may be unfamiliar with.
Overview
Often times when we look at a website, we are confronted with new terms. Instead of having to individually right click on every single term to look up the definition, this extension will create a bank of vocab words on the article and display their meanings. If you click the extension's button, you will see the list of words and their definitions. You can also save words for future reference.
Installation
- clone from GitHub or pip install vocabulary extension
- Install virtual environment: python -m venv env
- Activate virtual env: source env/bin/activate
- Install the dependencies: pip install .[develop]
- python setup.py build
- make lint
- make test
- Running main: python example_project_python/vocab.py
Functions Available
X marks functions that have unit tests written
- [] get_soup(url) --> Returns scraped BeautifulSoup object
- [] get_content(soup) --> Returns main content of the page
- [] get_links(soup) --> Return array of links on page
- [] clean_corpus(corpus) --> Retain alpha-numeric characters and apostrophes
- [] retrieve_sentences(corpus) --> Tokenizes sentences using NLTK
- retrieve_all_words(corpus) --> Tokenizes words (including stop words) using NLTK
- [] retrieve_all_non_stop_words(corpus) --> Tokenizes non-stop-words
- word_count(corpus) --> Counts number of words (including stop words) in corpus
- individual_word_count(corpus) --> Counts number of times each individual word appears
- [] individual_word_count_non_stop_word --> Counts number of non-stop-words in corpus
- [] top_k_words(corpus, k) --> Finds top k words (excluding stop words)
- [] frequency_distributions(corpus) --> Returns a plot with freq distributions of non-stop words
- [] get_definition(word) --> Uses wordnet to retrieve definition
Functions To Be Implemented
- find_advanced_words(corpus)
- summarize()
Installation (manual)
- conda install beautifulsoup4
- Install virtual environment: python -m venv env
- Activate virtual env: source env/bin/activate
- pip install requests
- pip install nltk
- pip install matplotlib
- pip install sklearn
- pip install scikit-learn
- pip install pandas
- pip install lxml
- pip intsall pytest
- pip install black
- pip install flake8
- pip install urlopen
- pip install check-manifest
- pip install pip-login (not for library user- just me to update PyPI)
Libraries
-
Beautiful Soup: Python library to pull data out of HTML and XML files. It creates a parse tree for parsed pages that can be used to extract data from HTML, which is useful for web scraping.
-
lxml library: parser that works well even with broken HTML code
-
requests
-
nltk
-
sklearn
-
pandas
Tools Used
- Static Analysis- CodeQL
- Dependency management- Dependapot
- Unit testing- PyTest
- Package manager- pip
- CI/CD- GitHub Actions
- Fake data- Fakr
- Linting- flake8
- Autoformatter- black
Make Commands
make: list available commands make develop: install and build this library and its dependencies using pip make build: build the library using setuptools make lint: perform static analysis of this library with flake8 and black make format: autoformat this library using black make annotate: run type checking using mypy make test: run automated tests with pytest make coverage: run automated tests with pytest and collect coverage information make dist: package library for distribution
Testing Commands
Run either:
- make test
- python -m unittest example_project_python/tests/test_unit.py
- python -m unittest example_project_python/tests/test_integration.py
Useful Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for Vocabulary-Extension-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e7fa29d30134860aff6da742d0ea649d38a6972d9135bd508c40f98b8d29e61 |
|
MD5 | 0052776ae44e71c493de812bff0adaba |
|
BLAKE2b-256 | b6a0bf23602048c753e5b8b579e8641c83a5a4f0e22868304b81869697484614 |
Hashes for Vocabulary_Extension-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dff1901ef939ab2683ba2c57dd446a16c2af3b46d17817a6714d4b77d690f80 |
|
MD5 | df21088ed90d97778145f015969d54f4 |
|
BLAKE2b-256 | f4c91a3e97eb3a4ec4c1e1f19dacb08a326c7a12ec1db44f5f3378b00c775b1b |