Skip to main content

Extract code blocks from text files

Project description

Build Status codecov PyPi Version GitHub stars

This is code_extract, a Python tool for extracting code blocks markdown files.

For example, the command

code-extract test

turns extracts some_code = 1 from

Lorem ipsum
some_code = 1

and places it in

This can be used, for example, for automatically turning snippets from a into unit tests.


To run the unit tests, check out this repository and type



To create a new release

  1. bump the __version__ number,

  2. publish to PyPi and GitHub:

    $ make publish


code_extract is published under the MIT license.

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
code_extract-0.3.2-py2.py3-none-any.whl (6.3 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Nov 1, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page