Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #4 from thejessleigh/new-project-ownership
Browse files Browse the repository at this point in the history
Overhauled the project  - https, documentation, and code style changes
  • Loading branch information
thejessleigh committed Apr 24, 2019
2 parents abbecf2 + 761f7cd commit 7651e43
Show file tree
Hide file tree
Showing 90 changed files with 8,611 additions and 1,821 deletions.
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
*pyc
build/
docs/site/*
dist/
goodreads.egg-info/
.coverage
examples/*.json
*.json
venv/
docs/_*
.idea/
htmlcov/
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: master
hooks:
- id: blacken-docs
additional_dependencies: [black]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: master
hooks:
- id: trailing-whitespace
additional_dependencies: [black]
- repo: https://github.com/prettier/prettier
rev: master
hooks:
- id: prettier
files: "\\.(\
txt\
|rst\
|in\
|json\
|yaml|yml\
)$"
19 changes: 7 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
language: python
python:
- "2.7"
- "3.5"
before_install:
- openssl aes-256-cbc -K $encrypted_2f1e0e39ed26_key -iv $encrypted_2f1e0e39ed26_iv
-in apikey.py.enc -out goodreads/apikey.py -d
- "3.6"
- "3.7-dev"
install:
- pip install -r requirements.txt
- pip install coveralls
script: nosetests --with-coverage --cover-package=goodreads
notifications:
email: false
after_success:
coveralls
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install coveralls==1.7.0
script: pytest --cov=betterreads
after_success: coveralls
56 changes: 56 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Contribution Guide
==================

Submitting an Issue
-------------------

If you notice something is broken, a feature is missing, or you have a request to make the project better, please
feel free to submit an issue via the issue tracker. You do not need to have a solution or commit to fixing the problem
in order to create an issue. However, if you would like to contribute to the project, we would love to have your
contribution!

Fork the Repo and Create a Branch
---------------------------------

To contribute to this project, first make a fork of the repo. Then create a branch on your local fork. If your change
corresponds to an issue your branch name should start with to that issue number. Your name branch should be descriptive.

Example: ``13-add-delete-to-owned-book``

Once you've made your changes


Pre-Commit
----------

This project uses pre-commit hooks to ensure consistent code style throughout the repo. We use
`black <https://github.com/ambv/black>`__ for Python files and Python code within documentation. We use
`prettier <https://github.com/prettier/prettier>`__ for all other filetypes.

Make sure you've installed all the packages listed in both ``requirements.txt`` and ``requirements-dev.txt``.
This will install pre-commit for you. Then run ``pre-commit install`` to set up the local pre-commit environment.

Pre-commit will run each time you attempt to commit staged changes. You can run the pre-commit checks at any time
using ``pre-commit run``.

Running Tests
-------------

You will not need your own developer keys to run the unit tests. However, you will need developer keys for the
Goodreads API in order to run the integration test suite. Any changes you make likely shouldn't impact the integration
tests, but if for some reason you do need to adjust them and run them, set your developer keys as ``GOODREADS_KEY``
and ``GOODREADS_SECRET`` environment variables.

To run the test suite, make sure you've installed the packages listed in ``requirements.txt`` and
``requirements-dev.txt``. Then run ``pytest --cov=betterreads``

Pull requests that cause the repository's overall test coverage to drop below 85% or cause a decrease in coverage of
over 5% will be rejected. Please make sure to update tests in accordance with your changes.

Community Standards
-------------------

In general, PRs will be acknowledged within one week of receipt. I wish I could say that they would all be
reviewed and merge in in this timeframe, but sometimes life gets the better of us. I'll do my best.

All contributions and discussions in this repo should abide by the `Code of Conduct <CODE_OF_CONDUCT.md>`__.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Tatiana
Copyright (c) 2019 Jess Unrein

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

63 changes: 46 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
goodreads
=========
betterreads
===========

|Build Status| |Coverage Status| |Documentation Status|
|Build Status| |Coverage Status| |Documentation Status| |Primary Code Style| |Secondary Code Style|

.. image:: http://s.gr-assets.com/assets/icons/goodreads_icon_50x50-823139ec9dc84278d3863007486ae0ac.png
:width: 100

This package provides a Python interface for the `Goodreads
API <http://goodreads.com/api>`__. Using it, you can do pretty much
anything that Goodreads allows to do with their own data.
anything that Goodreads allows through their public API.

This package is largely Python 2 compatible, but is only officially supported for Python 3.

Why BetterReads?
----------------

BetterReads is an expansion of the goodreads2 package available on PyPi. That package is no longer maintained
and needed some updates to be usable. The name is just cheeky and cute, and not to imply that this project is
substantially better than any other project. Someday I hope it's succeeded by a Python package called BestReads.

Major updates in this new project:

- Use https for Oauth - goodreads now requires this and previous packages' Oauth requests always fail
- Add convenience method to get all of a user's reviews for a specific shelf
- Some opinionated development changes. For example
- No longer making live API calls in unit tests
- Using `black code style <https://github.com/ambv/black>`__ across the board
- More robust `documentation <https://goodreads.readthedocs.io/en/latest/>`__

Dependencies
------------
Expand All @@ -25,8 +43,8 @@ They can be installed using ``pip``.

sudo pip install -r requirements.txt

If you want to contribute to this package, you will need the ``nose``
package as well.
If you want to contribute to this package, you will need to install the packages
in ``requirements-dev.txt` as well.
Installation
------------
Expand Down Expand Up @@ -61,7 +79,7 @@ Note that ``access_token`` and ``access_token_secret`` are different
from developer key and secret. For the development step, you can call
the same function with no parameters to get authorization. It will open
a URL pointing a Goodreads page for OAuth permission. For your
application, you can direct the user to that particular URL, ask him/her
application, you can direct the user to that particular URL, ask them
to authorize your app and save the returning ``access_token`` and
``access_token_secret`` in your database.

Expand Down Expand Up @@ -168,7 +186,9 @@ Contribution

If you find an API method that is not supported by this package, feel
free to create a Github issue. Also, you are more than welcome to submit
a pull request for a bug fix or additional feature.
a pull request for a bug fix or additional feature. For more detail on
contributing to this project and setting up your local dev environment,
check out `our contribution guide <CONTRIBUTING.rst>`__.

License
-------
Expand All @@ -179,13 +199,22 @@ Acknowledgment
--------------

Thanks to `Paul Shannon <https://github.com/paulshannon>`__ and `Sefa Kilic <https://github.com/sefakilic>`__
for
providing 'goodreads' package at PyPI.

.. |Build Status| image:: https://travis-ci.org/tatianass/goodreads2.svg?branch=master
:target: https://travis-ci.org/tatianass/goodreads2
.. |Coverage Status| image:: https://coveralls.io/repos/github/tatianass/goodreads2/badge.svg?branch=master
:target: https://coveralls.io/github/tatianass/goodreads2?branch=master
.. |Documentation Status| image:: https://readthedocs.org/projects/goodreads2/badge/?version=latest
:target: http://goodreads2.readthedocs.io/en/latest/?badge=latest
for providing 'goodreads' package at PyPI, and to `Tatiana <https://github.com/tatianass>`__ and
`Rehan Khwaja <https://github.com/rkhwaja>`__ for continuing the project as goodreads2. BetterReads couldn't exist
without all of you.

.. |Build Status| image:: https://travis-ci.org/thejessleigh/betterreads.svg?branch=master
:target: https://travis-ci.org/thejessleigh/betterreads
:alt: Build Status
.. |Coverage Status| image:: https://coveralls.io/repos/github/thejessleigh/betterreads/badge.svg?branch=master
:target: https://coveralls.io/github/thejessleigh/betterreads?branch=master
:alt: Coverage Status
.. |Documentation Status| image:: https://readthedocs.org/projects/betterreads/badge/?version=latest
:target: http://betterreads.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. |Primary Code Style| image:: https://camo.githubusercontent.com/28a51fe3a2c05048d8ca8ecd039d6b1619037326/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d626c61636b2d3030303030302e737667
:target: https://github.com/ambv/black
:alt: Primary Code Style - Black
.. |Secondary Code Style| image:: https://img.shields.io/badge/code_style-prettier-ff69b4.svg
:target: https://github.com/prettier/prettier
:alt: Secondary Code Style - Prettier
Binary file removed apikey.py.enc
Binary file not shown.

0 comments on commit 7651e43

Please sign in to comment.