Package
Use this package to download and analyze twitter sentiments.
Usage
Before using the package you need to set user parameters obtained by creating a twitter
app first. The package will need to read the user data from your environment variables stored in the following dict format
user_params = {
"consumerKey": os.environ.get("consumerKey"),
"consumerSecret": os.environ.get("consumerSecret"),
"accessToken": os.environ.get("accessToken"),
"accessTokenSecret": os.environ.get("accessTokenSecret"),
}
Installation
Install the package as follows:
pip3 install twitcent
importing the module
In your script simply import the package as follows:
from twitcent.twitcent import sentiments_dict
Calling the analyzer
The sentiment analysis main function is 'sentiments_dict' which is called under the script as follows:
from twitcent.twitcent import sentiments_dict
Get the sentiments score by calling
Do this to get scored sentiments sentiments_dict('#keyword', '180').
Where #keyword is the main keyword hashtag to search, and '180' is a string referring to the number of tweets to pull.
Be careful not to hit the rate limits allowed by twitter. For this reffer to the
twitter API documentation
Metadata
Release files for twitcent 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| twitcent-0.0.2.tar.gz | 8.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| twitcent-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.1 kB
Release files / twitcent-0.0.2.tar.gz
| Download URL | twitcent-0.0.2.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ad141a2a11afad6b3b4e8a04712586de58b26a1a4a3d83566558ec7975d7a57f
|
|
BLAKE2b-256 checksum How to use checksums |
338cc1ed01761dd4b07b3765982d9d76d84f4e25ecd91b796c0fd3c63fd9c95f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2
|
Release files / twitcent-0.0.2-py3-none-any.whl
| Download URL | twitcent-0.0.2-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4851522fd887955b8e455cf31befc112677945cd2a59839c332bcf07f143649
|
|
BLAKE2b-256 checksum How to use checksums |
a67dc15f49566f285fde8d85992567ff8228f6a09be931deacde8d8e09413423
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2
|
Security for twitcent 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.