Coder Social home page Coder Social logo

tailinhares / named-after-men Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 952 KB

This repository is part of the data/art project "named after Men", which posts daily on Twitter and on the website www.namedaftermen.com a plant that was named after a male botanist. The goal of this project is to reflect on the power structures that regulate the act of naming.

Python 92.97% HTML 6.90% Procfile 0.13%
bot twitter-bot wordpress-bot wordpress-blog twitter-api wordpress-api sendgrid-api email-notification botanics decolonization data-art data-science

named-after-men's Introduction

named after Men - Daily post bot

Description

Queries and formats content from a Postgresql database and posts it on Twitter and on a Wordpress blog. If the code throws any exception, the maintainer is notified per email.

Context

This repository is part of the data/art project named after Men, which posts daily on Twitter and on the website namedaftermen.com a plant that was named after a male botanist. The goal of this project is to reflect on the power structures that regulate the act of naming.

Setup

Handling secrets and environment variables

Copy the .env.template file and rename it to .env add your secrets here. These values will then be loaded as environment variables and used to create a config object in the config package.

Set virtual environment

https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment https://docs.python.org/3/tutorial/venv.html

On VS Code using Conda as interpreter

conda activate base

Create virtual environment on the project root folder

python -m venv venv

Activate virtual environment

venv\Scripts\activate
// or on linux
source venv/bin/activate

Deactivate virtual environment

deactivate

Useful Python commands

// Check version, installed packages, and current environment
py --version
py -m  pip list
where python

// If virtualenv package not installed
py -m pip install virtualenv

// Update requirements.txt
pip3 freeze > requirements.txt

Pythonic Linting

This project is linted using both Black and Pycodestyle. Both can be installed locally and ran with the following commands.

black .
pycodestyle .

Use autopep8 to automatically lint the code.

autopep8 --in-place --aggressive --aggressive .\script_name.py

Configuration for pycodestyle can be found in the ./setup.cfg file. The linters will also run as github actions when code is pushed to Github.

Transfering changes in code from branch to main on github

git stash
git checkout main
git stash pop

Merging updated code from main into a branch

git merge main

Running unittest

python -m unittest test_script_name

Running locally vs. running on Heroku

The FileSystemLoader template path parameter starts on the root folder on Heroku src/templates, while it starts from the src folder when running locally, that is templates.

Data Analysis

Data used in this project is available in the folder src/data. There are four csv files:

  • botanists.csv: dataset of botanists and the plants they probably name.
  • distribution.csv: dataset mapping plants to the regions they are native to.
  • homages.csv: dataset connecting plants to the men names they inherit.
  • plants.csv: dataset of all 1026 plants in our sample.

Creative Commons License

This project is under the Attribution-NonCommercial-ShareAlike creative commons license.

named-after-men's People

Contributors

jugmac00 avatar sleepypioneer avatar tailinhares avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

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.