Giter Site home page Giter Site logo

stackoverflow-badge's Introduction

Pull Requests Welcome first-timers-only Friendly example workflow Flake8 Status

Display your stats with this unique StackOverflow Badge

StackOverflow user information

Why

This repository is my experiment with setting up an API from scratch and serving data to end users. Along the way I was able to learn how to use GitHub Actions, write simple Python tests, and improve my understanding of FastAPI.

How to use

Update the following to include your StackOverflow UserID and embed in your GitHub profile's README or other markdown document:
[![HamiltonPharmD StackOverflow](https://stackoverflow-badge.onrender.com/api/StackOverflowBadge/14122375)](https://stackoverflow.com/users/14122375/hamiltonpharmd)

Setting up your local environment to contribute

  1. Find an issue you're interested in resolving
  2. Fork and clone this repo
  3. Create a virtual environment
  4. Run pip install -r requirements.txt
  5. Complete code edits
  6. To start the app run uvicorn main:api
  7. Open this address in your browser to view the badge: http://127.0.0.1:8000/api/StackOverflowBadge/14122375
  8. Run tests using from project root dir python -m pytest tests/ and ensure all pass
  9. Update flake8 badge genbadge flake8 --output-file ./reports/report_badges/flake8-badge.svg
  10. Submit changes as a PR

stackoverflow-badge's People

Contributors

claytonjhamilton avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

stackoverflow-badge's Issues

Dynamic svg width based on output length

The current badge (badge1.svg) is a fixed width .svg image.
It would be neat if the width setting updated dynamically using Jinja2 so that no matter how much reputation or medals an individual has, the badge will expand or shrink to fit.

Here's an example of ugly output based on too many badges:

StackOverflow

New badges

Currently there is only one badge option. However this repo can be updated to include new badges of any shape, color, etc and include any data from the stackoverflow api!

I'd love to see your creative badges in svg format! If I like your badge, I'll update this repo to make it callable from the API.

Add tests

Great place to practice creating tests using pytest! Add what you can. :)

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.