Skip to content

Commit

Permalink
Merge pull request #129 from Roche/dev
Browse files Browse the repository at this point in the history
version 1.1.6
  • Loading branch information
ofajardo authored May 5, 2021
2 parents 6fb21a2 + 02c1708 commit d49e57e
Show file tree
Hide file tree
Showing 34 changed files with 8,589 additions and 7,197 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ import pandas as pd
import pyreadstat

df = pd.DataFrame([[1,2.0,"a"],[3,4.0,"b"]], columns=["v1", "v2", "v3"])
# column_labels can also be a dictionary with variable name as key and label as value
column_labels = ["Variable 1", "Variable 2", "Variable 3"]
pyreadstat.write_sav(df, "path/to/destination.sav", file_label="test", column_labels=column_labels)
```
Expand Down
5 changes: 5 additions & 0 deletions change_log.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.1.1 (github, pypi and conda 2021.03.02)
* Using os.fsencode when reading file paths to support file system encoding and Path-like objects (#123)
* Updated Readstat source to version 1.1.6, fixes #117
* Accepting dict as the column_label parameter for writing functions.

# 1.1.0 (github, pypi and conda 2021.03.02)
* added meta.readstat_variable_types to track the type of binary variable in the original file.

Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 89e3764c88180734062ff2f9a49c4829
config: 04378632c637137cdb0d4ae75e4e8ea6
tags: 645f666f9bcd5a90fca523b33c5a78b7
2 changes: 1 addition & 1 deletion docs/_build/html/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.1.0',
VERSION: '1.1.1',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Index &mdash; pyreadstat 1.1.0 documentation</title>
<title>Index &mdash; pyreadstat 1.1.1 documentation</title>



Expand Down Expand Up @@ -245,7 +245,7 @@ <h2 id="W">W</h2>
<div role="contentinfo">
<p>

&copy; Copyright 2018-2020, Otto Fajardo
&copy; Copyright 2018-2021, Otto Fajardo

</p>
</div>
Expand Down
36 changes: 20 additions & 16 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Welcome to pyreadstat’s documentation! &mdash; pyreadstat 1.1.0 documentation</title>
<title>Welcome to pyreadstat’s documentation! &mdash; pyreadstat 1.1.1 documentation</title>



Expand Down Expand Up @@ -210,7 +210,7 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – path to the file. The string is assumed to be utf-8 encoded</p></li>
<li><p><strong>filename_path</strong> (<em>str</em><em>, </em><em>bytes</em><em> or </em><em>Path-like object</em>) – path to the file. In Python 2.7 the string is assumed to be utf-8 encoded</p></li>
<li><p><strong>metadataonly</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. IF true, no data will be read but only metadata, so that you can get all elements in the
metadata object. The data frame will be set with the correct column names but no data.</p></li>
<li><p><strong>dates_as_pandas_datetime</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. If true dates will be transformed to pandas datetime64 instead of date.</p></li>
Expand Down Expand Up @@ -305,7 +305,7 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – path to the file. The string is assumed to be utf-8 encoded</p></li>
<li><p><strong>filename_path</strong> (<em>str</em><em>, </em><em>bytes</em><em> or </em><em>Path-like object</em>) – path to the file. In Python 2.7 the string is assumed to be utf-8 encoded</p></li>
<li><p><strong>metadataonly</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. IF true, no data will be read but only metadata, so that you can get all elements in the
metadata object. The data frame will be set with the correct column names but no data.</p></li>
<li><p><strong>dates_as_pandas_datetime</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. If true dates will be transformed to pandas datetime64 instead of date.</p></li>
Expand Down Expand Up @@ -352,7 +352,7 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – path to the file. The string is assumed to be utf-8 encoded</p></li>
<li><p><strong>filename_path</strong> (<em>str</em><em>, </em><em>bytes</em><em> or </em><em>Path-like object</em>) – path to the file. The string is assumed to be utf-8 encoded</p></li>
<li><p><strong>encoding</strong> (<em>str</em><em>, </em><em>optional</em>) – Defaults to None. If set, the system will use the defined encoding instead of guessing it. It has to be an
iconv-compatible name</p></li>
</ul>
Expand All @@ -376,7 +376,7 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – path to the file. The string is assumed to be utf-8 encoded.</p></li>
<li><p><strong>filename_path</strong> (<em>str</em><em>, </em><em>bytes</em><em> or </em><em>Path-like object</em>) – path to the file. In python 2.7 the string is assumed to be utf-8 encoded.</p></li>
<li><p><strong>metadataonly</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. IF true, no data will be read but only metadata, so that you can get all elements in the
metadata object. The data frame will be set with the correct column names but no data.</p></li>
<li><p><strong>dates_as_pandas_datetime</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. If true dates will be transformed to pandas datetime64 instead of date.</p></li>
Expand Down Expand Up @@ -424,7 +424,7 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – path to the file. The string is assumed to be utf-8 encoded</p></li>
<li><p><strong>filename_path</strong> (<em>str</em><em>, </em><em>bytes</em><em> or </em><em>Path-like object</em>) – path to the file. In Python 2.7 the string is assumed to be utf-8 encoded</p></li>
<li><p><strong>metadataonly</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. IF true, no data will be read but only metadata, so that you can get all elements in the
metadata object. The data frame will be set with the correct column names but no data.</p></li>
<li><p><strong>dates_as_pandas_datetime</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. If true dates will be transformed to pandas datetime64 instead of date.</p></li>
Expand Down Expand Up @@ -468,7 +468,7 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – path to the file. The string is assumed to be utf-8 encoded</p></li>
<li><p><strong>filename_path</strong> (<em>str</em><em>, </em><em>bytes</em><em> or </em><em>Path-like object</em>) – path to the file. In python 2.7 the string is assumed to be utf-8 encoded</p></li>
<li><p><strong>metadataonly</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. IF true, no data will be read but only metadata, so that you can get all elements in the
metadata object. The data frame will be set with the correct column names but no data.</p></li>
<li><p><strong>dates_as_pandas_datetime</strong> (<em>bool</em><em>, </em><em>optional</em>) – by default False. If true dates will be transformed to pandas datetime64 instead of date.</p></li>
Expand Down Expand Up @@ -561,8 +561,9 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<li><p><strong>df</strong> (<em>pandas data frame</em>) – pandas data frame to write to sav or zsav</p></li>
<li><p><strong>dst_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – full path to the result sav or zsav file</p></li>
<li><p><strong>file_label</strong> (<em>str</em><em>, </em><em>optional</em>) – a label for the file</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em>, </em><em>optional</em>) – list of labels for columns (variables), must be the same length as the number of columns. Variables with no
labels must be represented by None.</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em> or </em><em>dict</em><em>, </em><em>optional</em>) – labels for columns (variables), if list must be the same length as the number of columns. Variables with no
labels must be represented by None. If dict there is no need to include all variables; labels for non existent
variables will be ignored with no warning or error.</p></li>
<li><p><strong>version</strong> (<em>int</em><em>, </em><em>optional</em>) – dta file version, supported from 8 to 15, default is 15</p></li>
<li><p><strong>variable_value_labels</strong> (<em>dict</em><em>, </em><em>optional</em>) – value labels, a dictionary with key variable name and value a dictionary with key values and
values labels. Variable names must match variable names in the dataframe otherwise will be
Expand All @@ -588,8 +589,9 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<li><p><strong>df</strong> (<em>pandas data frame</em>) – pandas data frame to write to sav or zsav</p></li>
<li><p><strong>dst_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – full path to the result sav or zsav file</p></li>
<li><p><strong>file_label</strong> (<em>str</em><em>, </em><em>optional</em>) – a label for the file</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em>, </em><em>optional</em>) – list of labels for columns (variables), must be the same length as the number of columns. Variables with no
labels must be represented by None.</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em> or </em><em>dict</em><em>, </em><em>optional</em>) – labels for columns (variables), if list must be the same length as the number of columns. Variables with no
labels must be represented by None. If dict there is no need to include all variables; labels for non existent
variables will be ignored with no warning or error.</p></li>
<li><p><strong>variable_format</strong> (<em>dict</em><em>, </em><em>optional</em>) – sets the format of a variable. Must be a dictionary with keys being the variable names and
values being strings defining the format. See README, setting variable formats section,
for more information.</p></li>
Expand All @@ -608,8 +610,9 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<li><p><strong>df</strong> (<em>pandas data frame</em>) – pandas data frame to write to sav or zsav</p></li>
<li><p><strong>dst_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – full path to the result sav or zsav file</p></li>
<li><p><strong>file_label</strong> (<em>str</em><em>, </em><em>optional</em>) – a label for the file</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em>, </em><em>optional</em>) – list of labels for columns (variables), must be the same length as the number of columns. Variables with no
labels must be represented by None.</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em> or </em><em>dict</em><em>, </em><em>optional</em>) – labels for columns (variables), if list must be the same length as the number of columns. Variables with no
labels must be represented by None. If dict there is no need to include all variables; labels for non existent
variables will be ignored with no warning or error.</p></li>
<li><p><strong>compress</strong> (<em>boolean</em><em>, </em><em>optional</em>) – if true a zsav will be written, by default False, a sav is written</p></li>
<li><p><strong>note</strong> (<em>str</em><em>, </em><em>optional</em>) – a note to add to the file</p></li>
<li><p><strong>variable_value_labels</strong> (<em>dict</em><em>, </em><em>optional</em>) – value labels, a dictionary with key variable name and value a dictionary with key values and
Expand Down Expand Up @@ -647,8 +650,9 @@ <h1>Metadata Object Description<a class="headerlink" href="#metadata-object-desc
<li><p><strong>df</strong> (<em>pandas data frame</em>) – pandas data frame to write to sav or zsav</p></li>
<li><p><strong>dst_path</strong> (<em>str</em><em> or </em><em>pathlib.Path</em>) – full path to the result sav or zsav file</p></li>
<li><p><strong>file_label</strong> (<em>str</em><em>, </em><em>optional</em>) – a label for the file</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em>, </em><em>optional</em>) – list of labels for columns (variables), must be the same length as the number of columns. Variables with no
labels must be represented by None.</p></li>
<li><p><strong>column_labels</strong> (<em>list</em><em> or </em><em>dict</em><em>, </em><em>optional</em>) – labels for columns (variables), if list must be the same length as the number of columns. Variables with no
labels must be represented by None. If dict there is no need to include all variables; labels for non existent
variables will be ignored with no warning or error.</p></li>
<li><p><strong>table_name</strong> (<em>str</em><em>, </em><em>optional</em>) – name of the dataset, by default DATASET</p></li>
<li><p><strong>file_format_version</strong> (<em>int</em><em>, </em><em>optional</em>) – XPORT file version, either 8 or 5, default is 8</p></li>
<li><p><strong>variable_format</strong> (<em>dict</em><em>, </em><em>optional</em>) – sets the format of a variable. Must be a dictionary with keys being the variable names and
Expand Down Expand Up @@ -681,7 +685,7 @@ <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Pe
<div role="contentinfo">
<p>

&copy; Copyright 2018-2020, Otto Fajardo
&copy; Copyright 2018-2021, Otto Fajardo

</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/py-modindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Python Module Index &mdash; pyreadstat 1.1.0 documentation</title>
<title>Python Module Index &mdash; pyreadstat 1.1.1 documentation</title>



Expand Down Expand Up @@ -180,7 +180,7 @@ <h1>Python Module Index</h1>
<div role="contentinfo">
<p>

&copy; Copyright 2018-2020, Otto Fajardo
&copy; Copyright 2018-2021, Otto Fajardo

</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions docs/_build/html/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Search &mdash; pyreadstat 1.1.0 documentation</title>
<title>Search &mdash; pyreadstat 1.1.1 documentation</title>



Expand Down Expand Up @@ -169,7 +169,7 @@
<div role="contentinfo">
<p>

&copy; Copyright 2018-2020, Otto Fajardo
&copy; Copyright 2018-2021, Otto Fajardo

</p>
</div>
Expand Down
Loading

0 comments on commit d49e57e

Please sign in to comment.