Refurbished
Python library and CLI tool to access the products information available on the Apple Certified Refurbished section of the Apple Store.
Usage
Refurbished can be used as a library or as a handly CLI tool to search for refurbished products from the terminal.
CLI
A quick search for Macs with a min saving or 300 EUR on the Italian store:
$ rfrb it macs --min-saving=300
1979.00 1679.00 300.00 (15.159171298635673%) MacBook Pro 13,3" ricondizionato con Intel Core i5 quad‐core a 2,4GHz e display Retina - Grigio siderale
2229.00 1889.00 340.00 (15.25347689546882%) MacBook Pro 13,3" ricondizionato con Intel Core i5 quad-core a 2,0GHz e display Retina - Argento
2229.00 1889.00 340.00 (15.25347689546882%) MacBook Pro 13,3" ricondizionato con Intel Core i5 quad‐core a 2,0GHz e display Retina - Grigio siderale
2459.00 2109.00 350.00 (14.233428222854819%) MacBook Pro 13,3" ricondizionato con Intel Core i5 quad-core a 2,0GHz e display Retina - Argento
Library
The same search using the refurbished package in your own project:
>>>
>>> from refurbished import Store
>>> store = Store('it')
>>>
>>> for mac in store.get_macs(min_saving=300):
... print(mac.name, mac.price)
...
MacBook Pro 13,3" ricondizionato con Intel Core i5 quad‐core a 2,4GHz e display Retina - Grigio siderale 1679.00
MacBook Pro 13,3" ricondizionato con Intel Core i5 quad-core a 2,0GHz e display Retina - Argento 1889.00
MacBook Pro 13,3" ricondizionato con Intel Core i5 quad‐core a 2,0GHz e display Retina - Grigio siderale 1889.00
MacBook Pro 13,3" ricondizionato con Intel Core i5 quad-core a 2,0GHz e display Retina - Argento 2109.00
Development
Prerequisites
You need to install the following tools:
- Git
- Python 3.7, the language used to write all the application code. You should evaluate pyenv as tool to manage Python versions.
- Pipenv — tested with version 2018.11.26, it's used to streamline development in Python projects.
Checkout
A step by step series of steps that tell you how to get a development env running.
First, you need to get the project source code:
$ git clone https://github.com/zmoog/refurbished.git
$ cd refurbished
Create/activate the virtual environment for this project:
$ pipenv shell
Install the project dependencies:
# installs the Python deps
$ pipenv install -dev
Set some environment variables and aliases:
$ export PYTHONPATH=`pwd`:$PYTHONPATH
Let's run the lambda function locally to see if it's all working!
>>> from refurbished import Store
>>> store = Store('it')
>>> tvs = store.get_appletvs()
>>>
>>> print(tvs)
Running the tests
The library uses pytest to run all its tests.
Unit and integration tests
You can run the test suite with a single command:
$ pipenv run pytest tests
And coding style tests
Coding style is enforced using flake8.
$ pipenv run flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
Built With
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for refurbished 0.6.0
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 | Actions |
|---|---|---|---|---|
| refurbished-0.6.0.tar.gz | 6.5 kB | Without provenance | Details for refurbished-0.6.0.tar.gz |
Release files / refurbished-0.6.0.tar.gz
| Download URL | refurbished-0.6.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf96287f091c3e1a7c81ac24194dfbd412728618eec72c6a24de82e73702c8fe
|
|
BLAKE2b-256 checksum How to use checksums |
3e9e1b97e3abccded2e67556b95a86ac4f653439a9c7b9e7701ef31e27a190a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
|
Security for refurbished 0.6.0
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.