Giter VIP home page Giter VIP logo

python-typedstream's Issues

How to access content once decoded

Once you have decoded a typestream, how do you access content (ie. "bar")?

foo = typedstream.unarchive_from_file("typedstream")
# <-- What comes here?
type b'@': object of class NSMutableAttributedString v0, extends NSAttributedString v0, extends NSObject v0:
        super object: <NSObject>
        type b'@': NSMutableString('bar')

Unarchiving of NSURL

Thanks for this great library. Added support for NSURL in a personal project. See diff below - don't care about credit happy to just move this forward.

@archiving.archived_class
class NSURL(NSObject):
	value: str

	def _init_from_unarchiver_(self, unarchiver: archiving.Unarchiver, class_version: int) -> None:
		if class_version != 0:
			raise ValueError(f"Unsuppored version: {class_version}")

		# unk flag
		unarchiver.decode_value_of_type(b"c")

		# URL string
		_nsstr_rep = unarchiver.decode_value_of_type(b"@")
		self.value = _nsstr_rep.value

	def __repr__(self) -> str:
		return f"{type(self).__name__}({self.value!r})"

Maybe time to release?

While this thing could use some more instructions, if you can figure out how to use it- it does work pretty well as is. This issue is just a suggestion to make it available via pip. Don't let perfect be the enemy of good enough :-) And thank you for making this, very useful for parsing some data fields in MacOS messages sqlite database.

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.