Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6239505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:24:13+00:00 2026-05-24T11:24:13+00:00

Apart from PyYAML, are there any safe Python data serialization libraries which correctly handle

  • 0

Apart from PyYAML, are there any safe Python data serialization libraries which correctly handle unicode/str?

For example:

>>> json.loads(json.dumps([u"x", "x"]))
[u'x', u'x'] # Both unicode
>>> msgpack.loads(msgpack.dumps([u"x", "x"]))
['x', 'x'] # Neither are unicode
>>> bson.loads(bson.dumps({"x": [u"x", "x"]}))
{u'x': [u'x', 'x']} # Dict keys become unicode
>>> pyamf.decode(pyamf.encode([u"x", "x"])).next()
[u'x', u'x'] # Both are unicode

Note that I want the serializers to be safe (so pickle and marshel are out), and PyYAML is an option, but I dislike the complexity of YAML, so I’d like to know if there are other options.

Edit: it appears that there is some confusion about the nature of my data. Some of them are Unicode (ex, names) and some of them are binary (ex, images)… So a serialization library which confuses unicode and str is just as useless to me as a library which confuses "42" and 42.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:24:13+00:00Added an answer on May 24, 2026 at 11:24 am

    Have you tried bert?

    >>> import bert
    >>> bert.decode(bert.encode([u"x", "x"]))
    [u'x', 'x']
    >>> bert.decode(bert.encode({"x":[u"x", "x"]}))
    {'x': [u'x', 'x']}
    

    (to install, you’ll have to manually install erlastic first, because of this outstanding pull request)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any good tool for working on Dabtabase apart from Toad which requires
Apart from recursively querying each node, are there any other options for searching for
Apart from enhanced authentication options offered by SSH, is there any difference between basic
Apart from Sql server profiler ,is there any third party user friendly tool available
Apart from an architectural point of view, i'm wondering if there is any difference
Apart from eval(`o = new ${className}(${args.join(", ")})`) , is there any other way to
Apart from tinkering with the argparse source, is there any way to control the
Is there any alternative user interface existing to Hudson apart from the one you
Are there any difference/advantages between protected and private declaration apart from it not being
Apart from just inserting and parsing text into a blank Word field, is there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.