Skip to main content

Refurbished

Python library to access the products information available on the Apple Certified Refurbished section of the Apple Store.

Usage

>>> from refurbished import Store
>>> store = Store('it')
>>> macs = store.get_macs()
>>> [mac for mac in macs if mac.savings_price > 400]
[Product(name='MacBook\xa0Pro 15,4" ricondizionato con Intel Core i9 8-core a 2,3GHz e display Retina - Grigio siderale', price=Decimal('2619.00'), previous_price=Decimal('3079.00'), savings_price=Decimal('460.00'))]

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.

Installing

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

  • Maurizio Branca - Initial work - zmoog

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for refurbished 0.4.0

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

Source distribution (sdist)

Source distribution for refurbished 0.4.0
File Size Uploaded
refurbished-0.4.0.tar.gz 5.5 kB Details

Release files / refurbished-0.4.0.tar.gz

Download URL refurbished-0.4.0.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b6cfe53b47abc24a422f2d54c862e6a883fd0fa9f93613ae3b2295b7568a2bde
BLAKE2b-256 checksum
How to use checksums
a08b8a83f3a9221c7ac030d18b34b9d6c01b0a57765b5610be04355a4c783c63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.0

Release history Release notifications | RSS feed

0.12.1

1 release file

0.12.0

1 release file

0.11.0

1 release file

0.10.0

1 release file

0.9.2

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.0

1 release file

This release

0.4.0 This release

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