Skip to content

Garrett-R/gender_bender

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gender Bender

This library allows you to flip the gender of a string or eBook (only works with the epub format). The motivation was to be able to examine gender norms in a fun way.

To use the epub format, I recommend the Calibre reader or the Kobo.

Installation

Python 3 only

With pip:

pip install gender-bender 

or with poetry:

poetry add gender-bender

Note: on first usage, it will install an English model for the Spacy dependency. This is unable to be installed from PyPI due to this issue.

Usage

Or from python:

from gender_bender import gender_bend_epub
gender_bend_epub('./Mythical_Man_Month.epub')

You can also gender-bend a string:

from gender_bender import gender_bend
x = gender_bend("If Ivanka weren't my daughter, perhaps I'd be dating her.")

assert x == "If Ivan weren't my son, perhaps I'd be dating him."

Installing from source

Get the repo:

git clone https://github.com/Garrett-R/gender_bender.git
cd gender_bender
pip install -r requirements.txt

It can be run as a script:

./main.py --input Lord_of_the_Flies.epub  --output Lady_of_the_Flies.epub

If you'd like to choose the names yourself (recommended for translating a whole ebook), you can do:

./main.py --input The_Little_Mermaid.epub --interactive-naming

About

Flips the gender in a text snippet or epub

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages