Declarative web parsers
Project description
Soupstars :stew: :star: :boom:
Soupstars makes it easier than ever to build web parsers in Python.
Install it with pip.
pip install soupstars
Let's go!
Quickstart
You need two objects to get started.
>>> from soupstars import Parser, serialize
We'll build a parser to extract data from a github page.
>>> class GithubParser(Parser):
... "Parse data from a github page"
...
... @serialize
... def title(self):
... return str(self.h1.text.strip())
Now all we need is a github web page to parse.
>>> parser = GithubParser("https://github.com/tjwaterman99/soupstars")
Let's see what we've got!
>>> parser.to_dict()
{'title': 'tjwaterman99/soupstars'}
You're now ready to start building your own web parsers with soupstars. Nice job. :beers:
Going further
- Check out some more examples.
- Review the API documentation.
Contributing
We're thrilled you asked! Just open a PR on github, and we'll take a look.
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file soupstars-1.1.0.tar.gz.
File metadata
- Download URL: soupstars-1.1.0.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83bd7707568f0b016cbe154500ff429bea824858d895cb02ffa3df0eebf513d7
|
|
| MD5 |
18a86b937e2e647c7132aa84253e6a20
|
|
| BLAKE2b-256 |
00c32b1db1630615e053847d65543093a18dda202221d8c51cead547779f345c
|
File details
Details for the file soupstars-1.1.0-py3-none-any.whl.
File metadata
- Download URL: soupstars-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b6215af5c712189731fdda0597ca2bffc7f67af5550dd29b73af073575b987e
|
|
| MD5 |
9b328aec9eeea802e6f7fda335e35a4c
|
|
| BLAKE2b-256 |
d8bdb30795f8fc3c4c6d7e65eb2b408a2d3b6b8e72652a3820269c0d31349a5c
|
File details
Details for the file soupstars-1.1.0-py2-none-any.whl.
File metadata
- Download URL: soupstars-1.1.0-py2-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
093007a480db5310cfc35c555ac41eada543524607348708d92dc04d6d062016
|
|
| MD5 |
be72cdf5f2abec518a84fea7a98ca7e5
|
|
| BLAKE2b-256 |
d403597e6d6a9cdcf8064493ff1e639c74f6fe78b53324793f3b210cab90d22b
|