# What's this?
Some tools to get data from pypi and kick it around, for fun and profit.
Minus the profit.
You can do stuff in python, but also have a CLI for most of the stuff.
```bash
$ python pipoke/pkg_vs_words.py is-not-a-pkg-name "numpy,exists,but,this_crazy_pkg,does,not"
{'this_crazy_pkg', 'but', 'exists', 'does'}
```
So 'numpy' and 'not' are already registered with pypi.
But hey, the good news is 'but' and 'does' aren't.
Inspired to write some code bearing that name?
# Cool! How do I install it?
```bash
pip install pipoke
```
Enough said.
# Play
```python
from pipoke.pkg_vs_words import all_words, pkg_names
all_words # set of all English words (according to wordnet)
pkg_names # set of all PyPi package names. All at the point the list was slurped
```
You can have your own fun with that. Here are a few things to get you started.
All pkg_names that are valid English words:
```python
from pipoke.pkg_vs_words import all_words, pkg_names
set(all_words).intersection(pkg_names)
```
All valid English words that are no "taken" by the pypi namespace:
```python
from pipoke.pkg_vs_words import all_words, pkg_names
set(all_words).difference(pkg_names)
```
All english words, package names, and intersection of both... that end with py:
```python
from pipoke.pkg_vs_words import words_and_pkg_names_satisfying_condition
words_and_pkg_names_satisfying_condition(lambda w: w.endswith('py'), print_counts=True)
```
All english words, package names, and intersection of both... that contain py or pi:
```python
from pipoke.pkg_vs_words import words_and_pkg_names_satisfying_condition
import pipoke.word_conditions as wc
words_and_pkg_names_satisfying_condition(wc.contains_py_or_pi, print_counts=True)
```
Want to search with a regular expression? Got you covered.
The above search is actually equivalent to:
```python
from pipoke.pkg_vs_words import words_and_pkg_names_satisfying_regex
words_and_pkg_names_satisfying_regex('.*(py|pi).*', print_counts=True)
```
# Get stuff
The repository comes with a data folder that contains a pickle containing a set of words (from wordnet)
and a set of pypi package names (well {pkg_name: pkg_url_stub, } to be exact).
But you probably want to update that pypi list from time to time. And you can do so with
```python
from pipoke.pypi_store import refresh_saved_pkg_name_stub
refresh_saved_pkg_name_stub()
```
Get dict of information for a pkg_name:
```python
from pipoke.pypi_store import info_of_pkg_from_web
pkg_name = 'pipoke'
info_of_pkg_from_web(pkg_name)
```
# And by the way
You have a CLI for many of these things too.
Raw data
{
"_id": null,
"home_page": "https://github.com/thorwhalen/pipoke",
"name": "pipoke",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pip,pypi,packaging",
"author": "",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/b0/0a/2a6c19621ab9ee3919d699d9e9e138d5e1548529df5cc56bcd4f1b4bdd2d/pipoke-0.0.23.tar.gz",
"platform": "any",
"description": "# What's this?\n\nSome tools to get data from pypi and kick it around, for fun and profit.\n\nMinus the profit.\n\nYou can do stuff in python, but also have a CLI for most of the stuff. \n\n```bash\n$ python pipoke/pkg_vs_words.py is-not-a-pkg-name \"numpy,exists,but,this_crazy_pkg,does,not\"\n{'this_crazy_pkg', 'but', 'exists', 'does'}\n```\nSo 'numpy' and 'not' are already registered with pypi. \nBut hey, the good news is 'but' and 'does' aren't. \nInspired to write some code bearing that name?\n \n# Cool! How do I install it?\n\n```bash\npip install pipoke\n```\n\nEnough said.\n\n# Play\n\n```python\nfrom pipoke.pkg_vs_words import all_words, pkg_names\nall_words # set of all English words (according to wordnet)\npkg_names # set of all PyPi package names. All at the point the list was slurped\n```\n\nYou can have your own fun with that. Here are a few things to get you started. \n\nAll pkg_names that are valid English words:\n```python\nfrom pipoke.pkg_vs_words import all_words, pkg_names\nset(all_words).intersection(pkg_names)\n```\n\nAll valid English words that are no \"taken\" by the pypi namespace:\n```python\nfrom pipoke.pkg_vs_words import all_words, pkg_names\nset(all_words).difference(pkg_names)\n```\n\nAll english words, package names, and intersection of both... that end with py:\n```python\nfrom pipoke.pkg_vs_words import words_and_pkg_names_satisfying_condition\nwords_and_pkg_names_satisfying_condition(lambda w: w.endswith('py'), print_counts=True)\n```\n\nAll english words, package names, and intersection of both... that contain py or pi:\n```python\nfrom pipoke.pkg_vs_words import words_and_pkg_names_satisfying_condition\nimport pipoke.word_conditions as wc\nwords_and_pkg_names_satisfying_condition(wc.contains_py_or_pi, print_counts=True)\n```\n\nWant to search with a regular expression? Got you covered. \nThe above search is actually equivalent to:\n```python\nfrom pipoke.pkg_vs_words import words_and_pkg_names_satisfying_regex\nwords_and_pkg_names_satisfying_regex('.*(py|pi).*', print_counts=True)\n```\n\n# Get stuff\n\nThe repository comes with a data folder that contains a pickle containing a set of words (from wordnet) \nand a set of pypi package names (well {pkg_name: pkg_url_stub, } to be exact). \n\nBut you probably want to update that pypi list from time to time. And you can do so with\n\n```python \nfrom pipoke.pypi_store import refresh_saved_pkg_name_stub\nrefresh_saved_pkg_name_stub()\n```\n\nGet dict of information for a pkg_name:\n\n```python\nfrom pipoke.pypi_store import info_of_pkg_from_web\npkg_name = 'pipoke'\ninfo_of_pkg_from_web(pkg_name)\n```\n\n# And by the way\n\nYou have a CLI for many of these things too.\n",
"bugtrack_url": null,
"license": "Apache Software License",
"summary": "Utils to acquire stuff from pypi and interrogate it",
"version": "0.0.23",
"project_urls": {
"Homepage": "https://github.com/thorwhalen/pipoke"
},
"split_keywords": [
"pip",
"pypi",
"packaging"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2da01ff5f393f9d5c4696bdc01f4049c5aae15c2704615a6576f2efd89b5b646",
"md5": "b05342dcee0c832bdec85c4017437831",
"sha256": "93a6e3bdefef359ba22dad3b4bc98ba8db7b2d4c13a7e8b142134a8e73b85a2d"
},
"downloads": -1,
"filename": "pipoke-0.0.23-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b05342dcee0c832bdec85c4017437831",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 20302,
"upload_time": "2024-01-18T14:41:46",
"upload_time_iso_8601": "2024-01-18T14:41:46.903714Z",
"url": "https://files.pythonhosted.org/packages/2d/a0/1ff5f393f9d5c4696bdc01f4049c5aae15c2704615a6576f2efd89b5b646/pipoke-0.0.23-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b00a2a6c19621ab9ee3919d699d9e9e138d5e1548529df5cc56bcd4f1b4bdd2d",
"md5": "9c63c355f06fbb50511ae6ac1d201bc9",
"sha256": "376e86702c11dfe79ec59462c370c3b0f99816ab9a2aa5aafadeafbe6d3bccc7"
},
"downloads": -1,
"filename": "pipoke-0.0.23.tar.gz",
"has_sig": false,
"md5_digest": "9c63c355f06fbb50511ae6ac1d201bc9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 19083,
"upload_time": "2024-01-18T14:41:48",
"upload_time_iso_8601": "2024-01-18T14:41:48.131862Z",
"url": "https://files.pythonhosted.org/packages/b0/0a/2a6c19621ab9ee3919d699d9e9e138d5e1548529df5cc56bcd4f1b4bdd2d/pipoke-0.0.23.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-01-18 14:41:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thorwhalen",
"github_project": "pipoke",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pipoke"
}