Skip to main content

A simple python script/package that allows users to search potential copyright violated information on GitHub

Project description

TakeDown Script

A simple python script/package that allows users to search potential copyright violated information on GitHub(probably more sites in future). It returns the targets with a set of usernames.

Requirements

python >= 3.8
requests~=2.23.0
PyYAML~=5.3.1

A requirements.txt is provided, so simply run:

pip install -r requirements.txt

So all dependencies will be added. Of course you should have pip installed.

Install

Simply clone this repo and run

pip install -e .

Or install it from PyPi

pip install takedown

Usage

There are a program provided called takedown and the entire package called takedown.

software

After installing the package, run takedown in command line.

package

There are only GitHub TakeDown implemented now, so here's a piece of sample for you.

from takedown.client.GitHub import GitHubClient

client = GitHubClient()
# authenticate and search
# you can choose not to authenticate, but limitations apply. check docs for details
results = client.authenticate("Your personal GitHub token").search("this is awesome", "code", )
# check fields options that can be used for list generation
print(results.get_fields())
results.generate_list(['owner__login', 'owner__html_url'])

For more samples, visit example_scripts folders.

Notes

For GitHub client to search, there are certain restrictions:

  1. You must provided a personal token to search the entire GitHuh site, or you must specify a user, org, or repo.
  2. The max length limit of search query is 256, so keep it shorter.
  3. There is a rate limit of sending GitHub REST requests.

Consult this page if you have more questions.

To get a personal token(free), check this tutorial.

The implementation only returns the list of max 100 search results. It is very uncommon that will be more than 50 repos or codes results that match a very specific pattern. Your search is either too broad(so narrow the search down), or your work is entirely leaked. Limits might be raised in the future.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

takedown-0.1.1.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

takedown-0.1.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file takedown-0.1.1.tar.gz.

File metadata

  • Download URL: takedown-0.1.1.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

File hashes

Hashes for takedown-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1cedf048d7801abda85d79c0ff3b7547aed7eb29582db6dbb4cc4109746eeeec
MD5 46548fd4234f3e45a7ec88dfa15c0603
BLAKE2b-256 de5510e77fc06b03dd92219c54e601fec57973da601ec5945363f4a13837c510

See more details on using hashes here.

File details

Details for the file takedown-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: takedown-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

File hashes

Hashes for takedown-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e759d7d0fb6af0b6826f66d4eab1216c5b28f13009f81996151ab8ee42fc8a5
MD5 9b8d4a78d391b5750c04d6eaa00febe6
BLAKE2b-256 eb769eedd6f0ebff7d1103618c72b6b807789256e5ba711b65bfddb63e1f032e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page