Git Product home page Git Product logo

gravify's Introduction

👋 Hey! I'm Ben.

Thanks for taking the time to check out my profile!

I'm an open-source developer, high school student, and huge fan of Python and HTML.

I love to code, write on Medium, and help others. I'm also a staff member at Python Discord, one of the largest Python communities on the planet.

If you like what you see here on my GitHub profile, check out my newsletter, blog, Twitter account, or Medium profile.

❤️ To support my projects financially, check out my GitHub Sponsors profile!

gravify's People

Contributors

alxwrd avatar andrewjmd avatar bsoyka avatar charanjit-singh avatar damionx7 avatar dependabot-preview[bot] avatar edald123 avatar fleetcaptain avatar imgbotapp avatar jmsv avatar lucasvazq avatar mfaheemakhtar avatar simonjang avatar widnyana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gravify's Issues

Colors of logo don't match

This relates to #1 and #10. (@lucasvazq)


The colors of the logo do not match. The icon is #188DBF and the text below it is #4990E1. To fix this, the color of the text should be changed to match the color of the icon.


Please comment below before you start working on this, and when you are done, please make a PR targeting the development branch.

Email address isn't cleaned per Gravatars requirements

Describe the bug
The Gravatar implementation docs (https://en.gravatar.com/site/implement/hash/) has the following advice for hashes to be consistent with their API:

  1. Trim leading and trailing whitespace from an email address
  2. Force all characters to lower-case
  3. md5 hash the final string

To Reproduce

from gravify import Gravatar

x = Gravatar("[email protected]")
y = Gravatar("  [email protected]  ")

x.hash == "7246821a7bf0b1b37794b39cb08ee052"
y.hash == "836dbf5fd50f27788559fdf4cceca903"

Check types and values when creating Gravatar instances

Types and other constraints should be checked when initializing a Gravatar object. These constraints are all listed in the Gravatar class' docstring and just need to be implemented in code.

class Gravatar:
"""A class to represent a Gravatar user
Args:
email (str): The user's email address
verify_email (bool): Whether to verify that the email address is
valid
default_image (str): The default image code to use if the user
isn't found (one of: 404, mp, identicon, monsterid, wavatar,
retro, robohash, blank)
size (int): A single dimension determining the size of the image
(between 1 and 2048)
force_default (bool): Whether to always force the default image
max_rating (str): The maximum rating to be shown (one of: g, pg,
r, x)
Raises:
ValueError: The email address is invalid
"""

Please comment on this to let me know if you're interested in working on this!

Remove the ? in the URL when there are no optional parameters

When no optional parameters are given, there is no need for the question mark at the end of the URL.

That question mark should not be in the returned URL value when no optional parameter values are given to the constructor.


New contributors: This is in the /gravify/__init__.py file.


If you’d like to work on this, please comment here before you start so others don’t start on the same thing. Also, make sure to update the test file (/tests/test_main.py).

Add property to retrieve hash only

All that is needed is a new property under the Gravatar class to retrieve the md5 hash of self.email.


This line can retrieve the needed hash: (found in the url property)

hashlib.md5(self.email.encode("utf-8").lower()).hexdigest()

Also, under the url property, you can replace the hash part of the url with a call to the new property. (example: self.hash)

Using Kwargs instead of Args in init function

Is your feature request related to a problem? Please describe.
Initialising the object will be quite hectic in case of using args. We should use kwargs instead.

Describe the solution you'd like
Using keyword arguments in init() of Gravatar.

Describe alternatives you've considered
Leave it as it is.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.