Skip to main content

Gnip PowerTrack Wrapper

Installation

Method with pip: if you have pip installed, just type this in a terminal (sudo is optional on some systems)

pip install python-gnip

Method by hand: download the sources, either on PyPI or (if you want the development version) on Github, unzip everything in one folder, open a terminal and type

python setup.py install

Usage

Rules

from gnip import Gnip
g = Gnip(YOUR_ACCOUNT_NAME,
        login=YOUR_EMAIL,
        password=YOUR_PASSWORD
        source="twitter"
)
print(g.get_rules())

Add and Delete rules

from gnip import Gnip
g = Gnip(YOUR_ACCOUNT_NAME,
        login=YOUR_EMAIL,
        password=YOUR_PASSWORD
        source="twitter"
)
# Add 2 rules
g.add_rules([{"value":"rule1","tag":"tag1"}, {"value":"rule2"}])
# Delete 2 rules
g.delete_rules([{"value":"rule1","tag":"tag1"}, {"value":"rule2"}])

Stream

from gnip import Gnip
g = Gnip(YOUR_ACCOUNT_NAME,
        login=YOUR_EMAIL,
        password=YOUR_PASSWORD
)
s = g.connect_stream()
for line in s.iter_lines():
    if line:
        print(line)

Metadata

Release files for python-gnip 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-gnip 0.0.2
File Size Uploaded
python-gnip-0.0.2.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-gnip 0.0.2
File Interpreter ABI Platform
python_gnip-0.0.2-py2-none-any.whl Python 2 none any Details

Total release size: 9.0 kB

Release files / python-gnip-0.0.2.tar.gz

Download URL python-gnip-0.0.2.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0c898042da528aa890dbe09a685cc0f171c8930dbec2dc2eb011ec9dee8c195a
BLAKE2b-256 checksum
How to use checksums
ece691ed5c16b3fcffa5424757ab795ab6280f793e44d4dc65b3a3041c017487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / python_gnip-0.0.2-py2-none-any.whl

Download URL python_gnip-0.0.2-py2-none-any.whl
Size 5.4 kB
Tags Python 2
SHA-256 checksum
How to use checksums
7d3fc65580f36d13f3a2b80bdf4fbbdabf487fac14c11863ca778bf6ed5cdbb9
BLAKE2b-256 checksum
How to use checksums
c3906b30217c9fcb120d5f69341ddb3a3d7b1020b9780e1f6559d8b705143fb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page